package hypeerweb;

public class FindDeletionPoint extends FindExtremePoint {

	/**
	 * @param capNode
	 */
	public FindDeletionPoint(Node capNode) {
		super(capNode);
	}

	/**
	 * @return the largest Node in the HyPeerWeb
	 * @pre capNode is the actual capNode
	 * @post will return the deletion point
	 */
	public Node findExtremePointInPerfectCube() {
		return super.capNode;
	}

	/**
	 * @return the largest node in the HyPeerWeb
	 * @pre capNode is the actual capNode
	 * @post will return the deletion point
	 */
	public Node findExtremePointInImperfectWeb() {
		Node largest = super.capNode.getFold();
		while (!largest.getLargerNeighbors().isEmpty()) {
			largest = largest.getLargerNeighbors().last();
		}
		return largest;
	}
}
